import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import zuye from '../views/zuye.vue'
import yunye from '../views/yunye.vue'
import xitong from '../views/xitong.vue'
import user from '../components/caidan/user.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/zuye',
      name: 'zuye',
      component: () => import('../views/zuye.vue')
    },
    {
      path: '/yunye',
      name: 'yunye',
      component: () => import('../views/yunye.vue')
    },
    {
      path: '/xitong',
      name: 'xitong',
      component: () => import('../views/xitong.vue'),
      children: [
        {
          path: '/user',
          name: 'user',
          component: () => import('../components/caidan/user.vue')
        },
        {
          path: '/user2',
          name: 'user2',
          component: () => import('../components/caidan/user2.vue')
        },
        {
          path: '/user3',
          name: 'user3',
          component: () => import('../components/caidan/user3.vue')
        },
        {
          path: '/user4',
          name: 'user4',
          component: () => import('../components/caidan/user4.vue')
        }
      ]
    },
    {
      path: '/tou',
      name: 'tou',
      component: () => import('../components/caidan/tou.vue')
    },
    {
      path: '/tou2',
      name: 'tou2',
      component: () => import('../components/caidan/tou2.vue')
    }
  ]

})

export default router
